<style type="text/css">
	form.document input[type="text"],
	form.document textarea{
		width: 600px;
	}
	form.document textarea{
		height: 400px;
	}
	form.document label{
		width: 70px;
	}
	form.document .row.button{
		padding-left: 110px;
	}
</style>

<ul class="btn">
	<li><input type="text" name="keyword" /></li>
	<li><a href="javascript:void(0);" class="search">Search</a></li>
	<li><a href="javascript:void(0);" class="add">Add</a></li>
</ul>

<table class="records">
	<caption>
		<span>Title</span>
	</caption>
	<thead>
		<tr>
			<th width="13"><input type="checkbox" name="select" value="0"/></th>
			<th width="50"><a href="javascript:void(0);" data-field="0">type</a></th>
			<th>title</th>
			<th width="60"><a href="javascript:void(0);" data-field="6">createdAt</a></th>
			<th width="50">action</th>
		</tr>
	</thead>
	<tfoot><tr><td colspan="5"></td></tr></tfoot>
	<tbody><tr><td colspan="5"></td></tr></tbody>
</table>


<script type="text/x-tmpl" class="list-tmpl">
	<% var types = ['接口','数据库','杂项']; %>
	<% for(var i=0,l=records.length;i<l;i++) { %>
		<tr>
			<td><input type="checkbox" name="id[]" value="<%=records[i]['id']%>"/></td>
			<td><%=types[records[i]['type']]%></td>
			<td><%=records[i]['title']%></td>
			<td><%=records[i]['createdAt']%></td>
			<td><a href="javascript:void(0);" class="btn edit">Edit</a>
		</tr>
	<% } %>
</script>

<script type="text/x-tmpl" class="form-tmpl">
	<form action="php/index.php?controller=document&action=set" method="post" class="document">
		<input type="hidden" name="id"/>
		<div class="row">
			<label>type</label>
			<select name="type">
				<option value="1">接口</option>
				<option value="2">数据库</option>
				<option value="3">杂项</option>
			</select>
		</div>
		<div class="row"><label>title</label><input type="text" name="title"/></div>
		<div class="row"><label>content</label><textarea name="content"></textarea></div>
		<div class="row button"><input type="submit" name="submit" value="提交"/></div>
	</form>
</script>

